import {
    reqCatgrotList
} from '@/api'
const state = {
    catgrotlist: []
}
const mutations = {
    SET_CATGROTLIST(state, catgrotlist) {
        state.catgrotlist = catgrotlist
    }
}
const actions = {
    //获取首页三级列表数据
    async getCatgrotList({
        commit
    }) {
        try {
        const result = await reqCatgrotList()
        if(result.code===200){
            commit('SET_CATGROTLIST',result.data)
        }
        } catch (error) {
            alert('获取信息失败')
        }

    }
}
const getters = {}
export default {
    state,
    mutations,
    actions,
    getters
}
